﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Newtonsoft.Json;

namespace Sys.Serialize
{
    public static class Json
    {
        /// <summary>
        /// 将对象序列化为字符串
        /// </summary>
        /// <returns></returns>
        public static string GetString(Object Obj)
        {
            return JavaScriptConvert.SerializeObject(Obj);
        }
        /// <summary>
        /// 将字符串反序列化为对象
        /// </summary>
        /// <returns></returns>
        public static T GetObject<T>(string str)
        {
           
            return JavaScriptConvert.DeserializeObject<T>(str);
        }
    }
}
